// 所有user对象的接口调用
import request from '@/utils/request.js'

// 获取一个学生的所有信息
export const getStudentInfo = (Data) => {
    // 借助urlSearchParams完成传递
    return request.post('student/getStudentInfo', Data, {
        headers: {
            'Content-Type': 'application/json'
        }
    });
}

// 更新学生信息
export const upStudentInfo = (Data) => {
    // 借助urlSearchParams完成传递
    return request.post('student/updateStudentInfo', Data, {
        headers: {
            'Content-Type': 'application/json'
        }
    });
}

// 获得全部成绩
export const getAllStudy = () => {
    return request.get('score/getAll')
}

// 平时成绩
export const getRegular = (Data) => {
    return request.get('statistics/getRegular',{params:{studentId:Data}})
}

// 竞赛成绩
export const getCompetition = (Data) => {
    return request.get('statistics/getRegular',{params:{studentId:Data}}) 
}

// 获得总成绩
export const getTotal = (Data) => {
    return request.get('statistics/getTotal',{params:{studentId:Data}}) 
}

// 增加成绩
export const add = (Data) => {
    return request.post('score/add', Data, {
        headers: {
            'Content-Type': 'application/json'
        }
    }); 
}
// 修改成绩
export const update = (Data) => {
    return request.post('score/update', Data, {
        headers: {
            'Content-Type': 'application/json'
        }
    }); 
}
// 删除成绩
export const deleteInfo = (Date) => {
    return request.get('score/delete',{params:{id:Date}}) 
}